/*
Melissa Shannon	
Title: Are Americans Willing to Reject a Fiscal Benefit to Exclude Immigrants from Public Entitlements?


HYPOTHESES:

Stated-Hyp1: US citizens will be more likely to turn down a fiscal benefit if immigrants will also benefit from it.

	Test-Hyp1: US citizens will turn down a tax credit that is fiscally beneficial
	if immigrants also benefit from it (within savings condition)
	
	Test-Hyp2: US citizens will turn down a nutrition program that is fiscally beneficial
	if immigrants also benefit from it (within savings condition)

	Test-Hyp3: US citizens will turn down a college tuition policy that is fiscally beneficial
	if immigrants also benefit from it (within savings condition)
	
Stated-Hyp2: Opposition to fiscal benefit in order to exclude immigrants will be stronger for illegal vs. legal immigrants.

	Test-Hyp4: Opposition to a tax credit will be stronger if illegal immigrants will
	also benefit from it compared to if only legal immigrants benefit from it.
	
	Test-Hyp5: Opposition to a nutrition program will be stronger if illegal immigrants will
	also benefit from it compared to if only legal immigrants benefit from it.
	
	Test-Hyp6: Opposition to a college tuition policy will be stronger if illegal immigrants will
	also benefit from it compared to if only legal immigrants benefit from it.
	
Stated-Hyp3: Simulating a social and economic reward for maximizing enrollment will weaken opposition to immigrant participation.

	/* Note: all outcome questions in some way include a cue about fiscal savings 
	from the program. However only some questions include a numeric savings cue.
	We are assuming that this hypothesis pertains to the numeric savings
	*/
	
	Test-Hyp7: US citizens will turn down a tax credit that is fiscally beneficial
	if immigrants also benefit from it; but this effect will be weaker if a numeric 
	fiscal savings cue is shown.
	
	Test-Hyp8: US citizens will turn down a nutrition program that is fiscally beneficial
	if immigrants also benefit from it; but this effect will be weaker if a numeric 
	fiscal savings cue is shown.

	Test-Hyp9: US citizens will turn down a college tuition policy that is fiscally beneficial
	if immigrants also benefit from it; but this effect will be weaker if a numeric 
	fiscal savings cue is shown.

*/

clear all
use "ShannonS2.dta", clear

********************************************************************************

* CONSTRUCT INDICATORS OF EXPERIMENTAL MANIPULATIONS

* treatment variable 
	tab GROUP
	/* control statement only talks about benefit but not $ saving; 
	treatment talks about $ saving.
	*/
	
* immigrant cue
	recode GROUP (1/2=0) (3/6=1), gen(immigrant)
	tab immigrant

* undocumented immigrant cue (excluding experimental conditions without any immigrant cue)
	recode GROUP (3/4=0) (5/6=1) (*=.), gen(undocumented)
	tab undocumented	
	
* savings cue
	recode GROUP (1=0) (2=1) (3=0) (4=1) (5=0) (6=1), gen(savings)
	tab savings
	
* CONSTRUCT OUTCOME MEASURES

* exclusionary preferences 
	// higher values indicate agreement
	
	* child tax credit policy
	gen supp_taxcredit=Q1
	replace supp_taxcredit=Q4 if supp_taxcredit==.
	replace supp_taxcredit=Q7 if supp_taxcredit==.
	replace supp_taxcredit=Q10 if supp_taxcredit==.
	replace supp_taxcredit=Q13 if supp_taxcredit==.
	replace supp_taxcredit=Q16 if supp_taxcredit==.	
	
	* food nutrition program
	gen supp_nutrition=Q2
	replace supp_nutrition=Q5 if supp_nutrition==.
	replace supp_nutrition=Q8 if supp_nutrition==.
	replace supp_nutrition=Q11 if supp_nutrition==.
	replace supp_nutrition=Q14 if supp_nutrition==.
	replace supp_nutrition=Q17 if supp_nutrition==.
	
	* in-state tuition rates
	gen supp_college=Q3
	replace supp_college=Q6 if supp_college==.
	replace supp_college=Q9 if supp_college==.
	replace supp_college=Q12 if supp_college==.
	replace supp_college=Q15 if supp_college==.
	replace supp_college=Q18 if supp_college==.
	
	* excluding missing
	foreach var of varlist supp* {
	replace `var'=. if `var'>5
	lab val `var' Q1
	tab `var', mis
	}	
	

********************************************************************************

* TEST HYPOTHESIS 
	
	* Significance threshold for all tests is:
	di 0.05/3
	
* Test-Hyp1: US citizens will turn down a tax credit that is fiscally beneficial if immigrants also benefit from it.
	
	reg supp_taxcredit i.immigrant	if savings==1
	// do not reject.  0.000
	tess 1.immigrant -, init(ShannonS2) bonf(3)
	
* Test-Hyp2: US citizens will turn down a nutrition program that is fiscally beneficial if immigrants also benefit from it.

	reg supp_nutrition i.immigrant	if savings==1
	// do not reject.  0.000
	tess 1.immigrant -, bonf(3)
	
* Test-Hyp3: US citizens will turn down a college tuition policy that is fiscally beneficial if immigrants also benefit from it.

	reg supp_college i.immigrant	if savings==1
	// do not reject.  0.000
	tess 1.immigrant -, bonf(3)
	
* Test-Hyp4: Opposition to a tax credit will be stronger if illegal immigrants will also benefit from it compared to if only legal immigrants benefit from it.
	
	reg supp_taxcredit i.undocumented if immigrant==1
	// do not reject.  0.000
	tess 1.undocumented -, bonf(3)
	
* Test-Hyp5: Opposition to a nutrition program will be stronger if illegal immigrants will also benefit from it compared to if only legal immigrants benefit from it.
	
	reg supp_nutrition i.undocumented if immigrant==1
	// do not reject.  0.000
	tess 1.undocumented -, bonf(3)
	
* Test-Hyp6: Opposition to a college tuition policy will be stronger if illegal immigrants will also benefit from it compared to if only legal immigrants benefit from it.
	
	reg supp_college i.undocumented if immigrant==1
	// do not reject.  0.000
	tess 1.undocumented -, bonf(3)
	
* Test-Hyp7: US citizens will turn down a tax credit that is fiscally beneficial if immigrants also benefit from it; but this effect will be weaker if a numeric fiscal savings cue is shown.
	
	reg supp_taxcredit i.immigrant##i.savings	
	// do not reject.  0.881	
	tess 1.immigrant#1.savings -, bonf(3)
	
* Test-Hyp8: US citizens will turn down a nutrition program that is fiscally beneficial if immigrants also benefit from it; but this effect will be weaker if a numeric fiscal savings cue is shown.

	reg supp_nutrition i.immigrant##i.savings	
	// do not reject.  0.699	
	tess 1.immigrant#1.savings -, bonf(3)
	
* Test-Hyp9: US citizens will turn down a college tuition policy that is fiscally beneficial if immigrants also benefit from it; but this effect will be weaker if a numeric fiscal savings cue is shown.

	reg supp_college i.immigrant##i.savings	
	// do not reject.  0.418
	tess 1.immigrant#1.savings -, bonf(3)
